import React, { memo } from "react";
import { ShopGoodsItemWrapper } from "./style";
import { Route, Link, useHistory } from "react-router-dom";
export default memo(function index(props) {
  const { item } = props;
  return (
    <ShopGoodsItemWrapper>
      <Link
        key={item.id}
        to={`/goodsdetail?id=${item.id}&categoryId=${item.categoryId}`}
        target="_blank"
      >
        <div  className="goods-list-item">
          <div className="pic">
            <img src={item.pic} alt="" />
          </div>

          <div className="price">￥{item.minPrice.toFixed(2)}</div>
          <div title={item.name} className="name">
            {item.name}
          </div>
          <div className="other-num">
            <span>{item.numberOrders}人购买</span>
            <span>{item.numberFav}人收藏</span>
          </div>
        </div>
      </Link>
    </ShopGoodsItemWrapper>
  );
});
